//+------------------------------------------------------------------+ //| Gann HiLo - bars.mq4 | //| mladen | //| | //| Original introduced by Robert Krausz | //| (February 1998, Stocks & Commodities Magazine | //+------------------------------------------------------------------+ #property copyright "www.forex-tsd.com" #property link "www.forex-tsd.com" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red // // // // // extern int Lb = 10; double hi[]; double lo[]; double Hlv[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // // // // // int init() { IndicatorBuffers(3); SetIndexBuffer(0,hi); SetIndexDrawBegin(0,Lb+1); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(1,lo); SetIndexDrawBegin(1,Lb+1); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(2,Hlv); return(0); } // // // // // int start() { int counted_bars=IndicatorCounted(); int i,limit; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; // // // // // for(i=limit;i>=0;i--) { Hlv[i] = Hlv[i+1]; if(Close[i]>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv[i] = 1; if(Close[i]